//
//  EditViewController.m
//  lzl5-31
//
//  Created by 刘振霖 on 16/6/16.
//  Copyright © 2016年 lzl. All rights reserved.
//

#import "EditViewController.h"

@interface EditViewController ()
{
    UITextField *tf;
}
@end

@implementation EditViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
}

- (void)viewWillDisappear:(BOOL)animated
{
    if (self.delegate) {
        [self.delegate inputString:tf.text];
    }
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    if (!tf) {
        tf = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 44)];
    }
    [cell.contentView addSubview:tf];
    
    return cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end